home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / unix / tracker_4_3.lzh / tracker / prefs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  1.3 KB  |  77 lines

  1. /* prefs.c 
  2.     vi:se ts=3 sw=3:
  3.  */
  4. /* $Id: prefs.c,v 4.0 1994/01/11 17:53:41 espie Exp espie $
  5.  * $Log: prefs.c,v $
  6.  * Revision 4.0  1994/01/11  17:53:41  espie
  7.  * *** empty log message ***
  8.  *
  9.  * Revision 1.3  1994/01/09  17:36:22  Espie
  10.  * Generalized open.c.
  11.  *
  12.  * Revision 1.2  1994/01/07  15:06:26  Espie
  13.  * VERY stupid bug.
  14.  *
  15.  * Revision 1.1  1994/01/06  22:32:42  Espie
  16.  * Initial revision
  17.  *
  18.  */
  19.  
  20. #include <stdio.h>
  21. #include "defs.h"
  22. #include "extern.h"
  23. #include "prefs.h"
  24. #include "tags.h"
  25.  
  26. ID("$Id: prefs.c,v 4.0 1994/01/11 17:53:41 espie Exp espie $")
  27. LOCAL void init_prefs P((void));
  28.  
  29. LOCAL void (*INIT)P((void)) = init_prefs;
  30.  
  31. LOCAL struct tag preferences[NUMBER_PREFS];
  32.  
  33. LOCAL void init_prefs()
  34.    {
  35.    int i;
  36.    
  37.    for (i = 0; i < NUMBER_PREFS; i++)
  38.       preferences[i].type = BASE_PREFS + i;
  39.    }
  40.  
  41. VALUE get_pref(index)
  42. int index;
  43.    {
  44.    INIT_ONCE;
  45.  
  46.    return preferences[index-BASE_PREFS].data;
  47.    }
  48.  
  49. void set_pref(index, value)
  50. int index;
  51. VALUE value;
  52.    {
  53.    preferences[index-BASE_PREFS].data = value;
  54.    }
  55.  
  56. void set_pref_scalar(index, value)
  57. int index;
  58. int value;
  59.    {
  60.    VALUE temp;
  61.    
  62.    temp.scalar = value;
  63.    set_pref(index, temp);
  64.    }
  65.  
  66. int get_pref_scalar(index)
  67.    {
  68.    return get_pref(index).scalar;
  69.    }
  70.  
  71. struct tag *get_prefs()
  72.    {
  73.    INIT_ONCE;
  74.  
  75.    return preferences;
  76.    }
  77.